home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 June / 1994-06b.d64 / grocery lister (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  129 lines

  1. 0 rem copyright 1994 compute publications intl ltd - all rights reserved
  2. 10 clr:gosub110
  3. 20 forx=qto700:ready:pokex,y:next:poke53280,.:poke53281,.
  4. 30 dv=8:rem dev # is 8
  5. 40 gosub750
  6. 50 print"[147]"spc(14)"[159]grocery list
  7. 60 [153]"1sys initialize shopping list"rt$"2sys modify grocery list
  8. 70 print"3[158] print/display current shopping list"rt$"4[158] exit
  9. 80 l[178]17:[141]140:[158]q,.,17:[153]"well?"
  10. 90 [146]198,15:[161]x$:[139]x$[179]"1"[176]x$[177]"4"[167]80
  11. 100 [145][197](x$)[137]870,150,1000,1240:[137]50
  12. 110 [151]49,[194](47):[151]50,[194](48):rt$[178][199](13):dn$[178][199](17):f$[178]"gl.list
  13. 120 q=679:ni=450:nc=15:dimx$,a,b,c,d,e,l,px,u,v,x,y,z,z$
  14. 130 dimit$(ni),cp%(ni),ct$(nc):return
  15. 140 poke781,l:sys59903:return
  16. 150 px=1:gosub180
  17. 160 print"[147]save file to disk(y/n)":wait198,15:getx$:ifx$="y"then820
  18. 170 goto50
  19. 180 print"[147]":forx=1tonc:ifct$(x)=""thenct$(x)="none"
  20. 190 print""ct$(x):next
  21. 200 sysq,13,21:print"return[158] to exit
  22. 210 [158]q,7,22:[153]"cursor downsys to move cursor
  23. 220 sysq,2,23:print"[158]change category n[158]ame, s[158]elect category
  24. 230 x[178]px:e[178]px[171]1:[139]e[178].[167]e[178]15
  25. 240 l[178]1:[141]140
  26. 250 a[178]e[170]2:b[178]x[170]2:[158]q,.,b:[153]""ct$(x)"wait":[158]q,.,a:[153]""ct$(e)
  27. 260 [146]198,15:[161]x$:[139]x$[178]rt$[167][142]
  28. 270 [139]x$[178]"n"[167]310
  29. 280 [139]x$[178]"s"[167]px[178]x:[141]370:[137]180
  30. 290 [139]x$[178]dn$[167]e[178]x:x[178]x[170]1:[139]x[178]16[167]x[178]1
  31. 300 [137]240
  32. 310 px[178]x:x$[178]"":l[178]1:[141]140:[133]"new name";x$:[139]x$[178]""[167]240
  33. 320 x$[178][200](x$,36):ct$(x)[178]x$:l[178]x[170]2:[141]140:[158]q,.,l:[153]ct$(x)
  34. 330 l[178]1:[141]140:[153]"initialize food names in category(y/n)?
  35. 340 wait198,15:getx$:ifx$="y"then360
  36. 350 goto240
  37. 360 a=30*(x-1)+1:b=a+29:fory=atob:it$(y)="none":cp%(y)=.:next:goto240
  38. 370 a=30*(x-1)+1:b=a+15:c=a+29:v=(40-len(ct$(x)))/2-1
  39. 380 print"[147]":sysq,v,1:print"[159]"ct$(x):v=4:u=.:fory=1to30:v=v+1:d=a+y-1
  40. 390 ify=16thenu=19:v=5
  41. 400 ify>30then420
  42. 410 gosub690
  43. 420 next:sysq,7,21:print"cursor down[158] to move cursor
  44. 430 [158]q,6,22:[153]"returnsys to exit,  change nsysame
  45. 440 sysq,3,23:print"c[158] to toggle coupon, b[158] to toggle buy
  46. 450 y[178]1:e[178]30:[141]620
  47. 460 d[178]a[170]y[171]1:[146]198,15:[161]x$:[139]x$[178]rt$[167][142]
  48. 470 [139]x$[178]dn$[167]600
  49. 480 [139]x$[178]"c"[167]520
  50. 490 [139]x$[178]"b"[167]540
  51. 500 [139]x$[178]"n"[167]570
  52. 510 [137]460
  53. 520 [139]cp%(d)[178].[176]cp%(d)[178]2[167]cp%(d)[178]cp%(d)[170]1:[137]560
  54. 530 cp%(d)[178]cp%(d)[171]1:[137]560
  55. 540 [139]cp%(d)[179]2[167]cp%(d)[178]cp%(d)[170]2:[137]560
  56. 550 cp%(d)[178]cp%(d)[171]2
  57. 560 [141]690:[141]620:[137]460
  58. 570 x$[178]"":l[178]3:[141]140:[133]"new name";x$:[139]x$[178]""[167]590
  59. 580 x$[178][200](x$,16):it$(d)[178]x$
  60. 590 l[178]3:[141]140:[137]610
  61. 600 e[178]y:y[178]y[170]1:[139]y[178]31[167]y[178]1
  62. 610 [141]620:[137]460
  63. 620 [139]e[177]15[167]v[178]e[171]11:u[178]19:[137]640
  64. 630 v[178]e[170]4:u[178].
  65. 640 [141]680:[158]q,u,v:[153]""it$(a[170]e[171]1)"
  66. 650 ify>15thenv=y-11:u=19:goto670
  67. 660 v=y+4:u=.
  68. 670 gosub680:sysq,u,v:print""it$(a+y-1)"[146]":return
  69. 680 sysq,u,v:print"                ":return
  70. 690 sysq,u,v:ifcp%(d)=.orcp%(d)=2thenprint" ";:goto710
  71. 700 print"$";
  72. 710 ifcp%(d)<2thenprint" ";:goto730
  73. 720 print"*";
  74. 730 ifit$(d)=""thenit$(d)="none"
  75. 740 print""it$(d):return
  76. 750 print"[147]loading grocery file...
  77. 760 [159]2,dv,2,f$[170]",p,r":[160]2:[159]15,dv,15:[132]15,z,z$:[160]15
  78. 770 [139]z[178]62[167][142]
  79. 780 s$[178]f$[170]",s,r":[159]8,dv,8,s$
  80. 790 [129]x[178]1[164]ni:[132]8,it$(x):[132]8,cp%(x):[130]
  81. 800 [129]x[178]1[164]nc:[132]8,ct$(x):[130]
  82. 810 [160]8:[142]
  83. 820 [158]q,.,17:[153]"saving...
  84. 830 s$="@0:"+f$+",s,w":open8,dv,8,s$
  85. 840 forx=1toni:ifit$(x)=""thenit$(x)="none"
  86. 850 print#8,it$(x);rt$;cp%(x):next
  87. 860 forx=1tonc:print#8,ct$(x):next:close8:goto50
  88. 870 x$="":sysq,.,17:print"c[158]oupons, foods s[158]elected, b[158]oth, or f[158]ile
  89. 880 [146]198,15:[161]x$:[139]x$[178]rt$[167]80
  90. 890 [139]x$[178]"b"[167][129]y[178]1[164]ni:cp%(y)[178].:[130]:[137]80
  91. 900 [139]x$[178]"c"[167]940
  92. 910 [139]x$[178]"s"[167]970
  93. 920 [139]x$[178]"f"[167][141]110:[137]80
  94. 930 [137]880
  95. 940 [129]y[178]1[164]ni:[139]cp%(y)[178].[176]cp%(y)[178]2[167]960
  96. 950 cp%(y)[178]cp%(y)[171]1
  97. 960 [130]:[137]80
  98. 970 [129]y[178]1[164]ni:[139]cp%(y)[179]2[167]990
  99. 980 cp%(y)[178]cp%(y)[171]2
  100. 990 [130]:[137]80
  101. 1000 [158]q,.,17:[153]"psysrint or dsysisplay?
  102. 1010 wait198,15:getx$:ifx$=rt$then80
  103. 1020 ifx$="d"then1140
  104. 1030 ifx$="p"then1050
  105. 1040 goto1010
  106. 1050 l=17:gosub140:sysq,.,17:print"printing...
  107. 1060 e[178]1:[159]4,4,0:[129]x[178]1[164]nc:v[178](74[171][195](ct$(x)))[173]2[171]1:a[178].:b[178]30[172](x[171]1)[170]1:c[178]30[172]x
  108. 1070 [129]y[178]b[164]c:[139]cp%(y)[179]2[167]1130
  109. 1080 d[178]25[171][195](it$(y))
  110. 1090 [139]a[178].[167][152]4:[152]4:[152]4,[166]v)" "ct$(x)" wait":[152]4:a[178]1
  111. 1100 [139]cp%(y)[178].[176]cp%(y)[178]2[167][152]4," ";:[137]1120
  112. 1110 [152]4,"$";
  113. 1120 [152]4,it$(y)[166]d);:e[178]e[170]1:[139]e[178]4[167][152]4:e[178]1
  114. 1130 [130]:e[178]1:[130]:[152]4:[160]4:[137]50
  115. 1140 e[178]1:[129]x[178]1[164]nc:v[178](40[171][195](ct$(x)))[173]2[171]1:a[178].:b[178]30[172](x[171]1)[170]1:c[178]30[172]x
  116. 1150 [129]y[178]b[164]c:[139]cp%(y)[179]2[167]1200
  117. 1160 d[178]18[171][195](it$(y)):[139]a[178].[167][153]"load"[166]v)"open"ct$(x)"":a[178]1
  118. 1170 [139]cp%(y)[178].[176]cp%(y)[178]2[167][153]" ";:[137]1190
  119. 1180 [153]"$";
  120. 1190 [153]""it$(y)[166]d);:e[178]e[170]1:[139]e[178]3[167][153]:e[178]1
  121. 1200 [130]:e[178]1:[139]a[178].[167]1230
  122. 1210 [158]q,2,23:[153]"syshit any key to continue, qsys to quit
  123. 1220 wait198,15:getx$:ifx$="q"thenx=nc
  124. 1230 next:goto50
  125. 1240 sysq,.,17:print"really exit?":wait198,15:getx$:ifx$="y"thensys64738
  126. 1250 goto80
  127. 1260 data32,182,2,134,176,32,182,2,164,176,24,32,240,255,96,32,253,174,32,158
  128. 1270 data183,96
  129.